package com.csun.cmny.provider.service;


import com.csun.cmny.provider.dto.ExpenseCtrItemQueryDto;
import com.csun.cmny.provider.dto.ShowAllItemDto;
import com.csun.cmny.provider.pojo.ExpCtrItem;
import com.csun.cmny.provider.pojo.ExpenseCtr;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ExpCtrItemService {
    /**
     * 添加项目
     * author:liqian
     * date:2018-11-07 14:14
     */
    int insert(ExpCtrItem expCtrItem);
    /**
     * 删除项目
     * author:liqian
     * date:2018-11-07 14:15
     */
    int delExpCtrItemById(Integer itemId);
    /**
     * 修改项目
     * author:liqian
     * date:2018-11-07 14:14
     */
    int updateExpCtrById(ExpCtrItem expCtrItem);
    /**
     * 根据ExpCtrItem查询ExpCtrItem
     * author:liqian
     * date:2018-11-07 14:15
     */
    ExpCtrItem selectByExpCtrItem(ExpCtrItem expCtrItem);
    /**
     * 根据id查询ExpCtrItem
     * author:liqian
     * date:2018-11-07 14:16
     */
    ExpCtrItem selectById(Integer itemId);
    /**
     * 根据项目id批量修改isDelete值自动加一
     * author:liqian
     * date:2018-11-09 16:42
     */
    int updateBatch(List<ExpCtrItem> expCtrItemList);
    /**
     * 根据项目id批量修改isDelete值自动减一
     * author:liqian
     * date:2018-11-09 17:09
     */
    int updateBatchSub(List<ExpCtrItem> expCtrItemList);

    List<ExpCtrItem> setlectItemByExpensectrType(Map<String,Object> query);

    List<Map<String,Object>> showAll(ShowAllItemDto showAllItemDto);

    /**
     * query item list with page
     *
     * @param expenseCtrItemQueryDto    expense ctr item query dto
     *
     * @return  the page info.
     */
    PageInfo queryItemListWithPage(ExpenseCtrItemQueryDto expenseCtrItemQueryDto);

    /**
     * select oldman item count by item id
     *
     * @param itemId    item id
     *
     * @return  the int.
     */
    int selectOldmanItemCountByItemId(Integer itemId);

    /**
     * select set meal item count by item id
     *
     * @param itemId    item id
     *
     * @return  the int.
     */
    int selectSetMealItemCountByItemId(Integer itemId);


    /**
     * @description: TODO  判断服务项目是否被入院，待缴费，待评估状态的老人使用
     * @param: itemId 服务项目ID groupId 机构ID
     * @return:
     * @throws
     * @author huangxm
     * @date 2019/3/11 14:42
     */
    List<Map<String,Object>> isItemBeUsed(@Param(value = "itemId")Integer itemId, @Param(value = "groupId")Integer groupId);

    Integer newIsItemBeUsed(Integer itemId);
}
